#pragma once

#include <TrueText/TextMetrics.h>
#include <TrueText/TextLayout.h>
#include <boost/smart_ptr/shared_ptr.hpp>

namespace TrueText {

class FontImpl;

class Layouter
{
public:
	Layouter(boost::shared_ptr<FontImpl> font)
		: font(font)
	{ }

	boost::shared_ptr<TextLayout> Layout(int clipWidth, const wchar_t* text, TextAlign align);
private:
    void AppendDots(Line& line, LineMetrics& metrics) const;
    Dimensions MeasureSymbol(wchar_t ch) const;
    WordMetrics MeasureWord(const std::wstring& word) const;

	boost::shared_ptr<FontImpl> font;
};

}